//
//  KYIntroductionView.m
//  kuaiyi
//
//  Created by 杨亮 on 16/3/17.
//  Copyright © 2016年 kuaiyi. All rights reserved.
//

#import "KYIntroductionView.h"
#import "Header.h"
#import <Masonry.h>
#import "KYIntroductionModel.h"
#import "KYMatchDorctorModel.h"
#import <SVProgressHUD.h>

@interface KYIntroductionView ()
@property (nonatomic, weak)UILabel *label;
@end
@implementation KYIntroductionView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setUpUI];
//        self.backgroundColor = [UIColor redColor];
    }
    return self;
}
-(void)setUpUI{
    UILabel *label = [[UILabel alloc]init];
    [self addSubview:label];
    label.font = [UIFont systemFontOfSize:14];
    label.numberOfLines = 0;
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(10);
        make.left.equalTo(self.mas_left).offset(10);
        make.right.equalTo(self.mas_right).offset(-10);
    }];
    self.label = label;
    [self refreshData];
    }
-(void)refreshData{
    [SVProgressHUD show];
    [KYIntroductionModel getIntroductionModelWithDoctor_id:self.matchDorctorModel.doctor_id success:^(KYIntroductionModel *introductionModel) {
        self.label.text = introductionModel.introduction;
        [SVProgressHUD dismiss];
    }];

}
@end
